import http from "./index";

//封装数据接口

//=====================菜单管理接口
//获取列表
export const menulist = () => http.get('/menulist', { istree: 1 });
//添加   或者  编辑  接口
export const addOrEditMenu = (url: string, data: any) => http.post(url, data);
//删除接口
export const delMenu = (data: any) => http.post('/menudelete', data);
//编辑回显 一条数据
export const menuInfo = (params: any) => http.get('/menuinfo', params);


//=====================角色管理接口
//获取列表
export const rolelist = () => http.get('/rolelist');
//添加   或者  编辑  接口
export const addOrEditRole = (url: string, data: any) => http.post(url, data);
//删除接口
export const delRole = (data: any) => http.post('/roledelete', data);
//编辑回显 一条数据
export const roleInfo = (params: any) => http.get('/roleinfo', params);



//=====================管理员管理接口
//登录接口
export const login = (data: any) => http.post('/userlogin', data);
//添加   或者  编辑  接口
export const addOrEditUser = (url: string, data: any) => http.post(url, data);
//总数  总条数
export const usercount = ()=>http.get('/usercount');
//获取列表
export const userlist = (params:any)=>http.get('/userlist',params);
//获取一条数据
export const userInfo = (params:any)=>http.get('/userinfo',params);
//删除接口
export const delUser = (data:any)=>http.post('/userdelete',data); 